<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        localStorage.name = "张三";
        localStorage.name = "李四";
        localStorage.age = 20; // String()

        // sessionStorage.name = "张三";
        // sessionStorage.name = "李四";
        // sessionStorage.age = 20; // String()

        // localStorage.users = JSON.stringify([{ a: 1, b: 2 }])

        // console.log(localStorage.name);
        // const age = localStorage.age;
        // console.log(age);
        // console.log(JSON.parse(localStorage.users));


        // localStorage.age = '';
        // localStorage.removeItem('age');

        // localStorage.clear();

    </script>
</body>

</html>